package com.invest.utils.email;

import com.invest.utils.type.MessageStatusType;
import org.apache.commons.lang.StringUtils;

/**
 * <p>注释</p>
 *
 * @author yuyizhao
 * @version v0.1 2016/7/22 Exp
 */
public class SendEmailResult {
    // 是否成功
    private MessageStatusType stausType;
    //错误消息
    private String errorMessage;

    private SendEmailResult(MessageStatusType stausType){
        this.stausType = stausType;
    }
    public static SendEmailResult success(){
        SendEmailResult result = new SendEmailResult(MessageStatusType.S);
        result.setErrorMessage(StringUtils.EMPTY);
        return result;
    }
    public static SendEmailResult fail(String error){
        SendEmailResult result = new SendEmailResult(MessageStatusType.F);
        result.setErrorMessage(error);
        return result;
    }

    public MessageStatusType getStausType() {
        return stausType;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}
